﻿using FreeSql.DataAnnotations;
using NetTopologySuite.Geometries;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using ZhonTai.Admin.Core.Entities;

namespace ZhonTai.Admin.Domain.Patrol
{
    /// <summary>
    /// 任务配置
    /// </summary>
    [Table(Name = "patrol_taskconfig")]
    public class PatrolTaskConfigEntity : Entity
    {
        /// <summary>
        /// 任务配置
        /// </summary>
        public long TaskId { set; get; }

        /// <summary>
        /// 表单Id
        /// 问题：是否存在多个表单
        /// </summary>
        public long FormId { set; get; }

        /// <summary>
        /// 执行人
        /// </summary>
        public long[] Users { set; get; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartTime { set; get; }

        /// <summary>
        /// 截至时间
        /// </summary>
        public DateTime? EndTime { set; get; }

        /// <summary>
        /// 空间资源Id
        /// </summary>
        public long GeometryResourceId { set; get; }
        /// <summary>
        /// 集合对象：空间约束
        /// </summary>
        [Column(Name = "Geometry", DbType = "geometry")]
        public Geometry? Geometry { set; get; }

        /// <summary>
        /// 缓冲半径
        /// </summary>
        public float BufferRadis { set; get; }


        #region 导航属性

        /// <summary>
        /// 任务
        /// </summary>
        [Navigate(nameof(TaskId))]
        public virtual PatrolTaskEntity Task { set; get; }

        /// <summary>
        /// 表单
        /// </summary>
        [Navigate(nameof(FormId))]
        public virtual FormEntity Form { set; get; }
        #endregion

    }
}
